import React from "react";
import { HashRouter, Route, Link, Redirect } from 'react-router-dom'
import { Layout, Menu } from "antd";
import First from './components/First'
import Movie from './components/Movie'
import About from './components/About'
import './css/app.css'
const { Header, Footer } = Layout;

function App() {
  return (
    <HashRouter>
    <Layout className="layout">
      <Header>
        <div className="logo" />
        <Menu theme="dark" mode="horizontal" defaultSelectedKeys={["2"]}>
          <Menu.Item key="1"><Link to='/first'>首页</Link></Menu.Item>
          <Menu.Item key="2"><Link to='/movie/current/1'>电影</Link></Menu.Item>
          <Menu.Item key="3"><Link to='/about'>相关</Link></Menu.Item>
        </Menu>
      </Header>
      <Route exact render={()=>
        <Redirect to='/movie/current/1'></Redirect>
      }></Route>
      <Route path='/first' component={First}></Route>
      <Route path='/movie' component={Movie}></Route>
      <Route path='/about' component={About}></Route>
      <Footer style={{ textAlign: "center" }}>
       Aska react project ©2020 Created by Ant UED
      </Footer>
    </Layout>
    </HashRouter>
  );
}

export default App;
